<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<%@ include file="/common/taglibs.jsp"%>

<c:choose>
	<c:when test="${fn:length(notepadList) gt 0 }">
		<c:choose>
			<c:when test="${param.themeType eq null or param.themeType eq '' }">
				<c:forEach var="notepad" items="${notepadList }" varStatus="i">
					<table style="width: 100%;">
						<tr>
							<td rowspan="2" style="width: 60px;text-align: center;">
								<div style="width: 32px;height: 32px;margin-left: 12px;">
									<c:choose>
										<c:when test="${notepad.user.userInfo.avatar ne null }">
											<img src="${ctx }/images/avatar.gif" />
										</c:when>
										<c:otherwise>
											<img src="${ctx }/images/avatar.gif" />
										</c:otherwise>
									</c:choose>
								</div>
								<label class="label" style="margin-left: -2px;">${notepad.user.displayName }</label>
							</td>
							<td>
								<div style="float: left;">
									<c:choose>
										<c:when test="${notepad.type ge 100}">
											<img src="${ctx }/images/<fmt:message key='img_type_${notepad.type }'></fmt:message>" />
										</c:when>
										<c:otherwise>
											<img src="${ctx }/images/clock.png" />
										</c:otherwise>
									</c:choose>
									<label><fmt:formatDate value="${notepad.signInTime }" pattern="yyyy年MM月dd日 hh:ss"/></label>
								</div>
								<div style="float: left;margin-left: 50px;">
									<img src="${ctx }/images/<fmt:message key='img_mode_${notepad.mode }'></fmt:message>" />
									<label><fmt:message key="info_mode_${notepad.mode }"></fmt:message></label>
								</div>
							</td>
						</tr>
						<tr>
							<td style="padding-top: 15px;">
								<div class="container" style="width: 500px;height: 80px;">
									<div class="content">
										<div style="text-indent: 2em;">
											<c:choose>
												<c:when test="${notepad.type lt 100 }">
													<c:choose>
														<c:when test="${notepad.content eq '' or notepad.content eq null }">
															<label class="label">${notepad.user.displayName }</label> 于 <label class="label"><fmt:formatDate value="${notepad.signInTime }" pattern="yyyy年MM月dd日 hh:ss"/></label> , 通过  <label class="label"><fmt:message key="info_mode_${notepad.mode }"></fmt:message></label> 签到。
														</c:when>
														<c:otherwise>
															<label class="label"><fmt:message key='info_period_${notepad.period }'></fmt:message></label>&nbsp;&nbsp;通过<fmt:message key="info_style_${notepad.mode }"></fmt:message>&nbsp;&nbsp;<label class="label">签到</label>
															<br />
															<label class="label" style="margin-left: 2em;"><fmt:message key='info_type_${notepad.type }'></fmt:message></label>
															<br />
															<label style="margin-left: 2em;">附言：${notepad.content }</label>
														</c:otherwise>
													</c:choose>
												</c:when>
												<c:otherwise>
													${notepad.content }
												</c:otherwise>										
											</c:choose>
										</div>
									</div>
									<s style="left: 20px;"><i></i></s>
								</div>
							</td>
						</tr>
					</table>
					<c:if test="${!i.last }">
						<p />
						<hr />
					</c:if>
				</c:forEach>
			</c:when>
			<c:otherwise>
				<input type="hidden" id="total_notepad" value="${statisticList[0] }" />
				<input type="hidden" id="len_notepad" value="${fn:substringBefore(statisticList[0]/10, '.') - 1 }" />
		    	<div class="statis_info">
					<fmt:message key='info_statistic_${param.actionType }'></fmt:message>&nbsp;<label class="label">${statisticList[0] }</label>&nbsp;条，今日新增&nbsp;<label class="label">${statisticList[1] }</label>&nbsp;条，本周新增&nbsp;<label class="label">${statisticList[2] }</label>&nbsp;条，本月新增&nbsp;<label class="label">${statisticList[3] }</label>&nbsp;条。
		    	</div>
				<table class="statis_tab">
					<tr>
						<th width="15%">
							<span>记事属性</span>
						</th>
						<th width="15%">
							<span>记事设备</span>
						</th>
						<th>
							<span>记事内容</span>
						</th>
						<th width="25%">
							<span>记事时间</span>
						</th>
					</tr>
			    	<c:forEach var="notepad" items="${notepadList }">
						<tr>
							<td>
								<label><fmt:message key='info_type_${notepad.type }'></fmt:message></label>
							</td>
							<td>
								<img src="${ctx }/images/<fmt:message key='img_mode_${notepad.mode }'></fmt:message>" />
							</td>
							<td style="text-align: left;">
								${notepad.content }
							</td>
							<td>
								<label><fmt:formatDate value="${notepad.signInTime }" pattern="yyyy年MM月dd日 hh:ss "/></label>
							</td>
						</tr>
					</c:forEach>	
	    		</table>
				<c:if test="${statisticList[0] gt 10 }">
					<div id="pageBar_notepad" style="width: 570px;"></div>
				</c:if>
			</c:otherwise>
		</c:choose>	
	</c:when>
	<c:otherwise>
		暂无内容，快去添加新的记事！
	</c:otherwise>
</c:choose>
